package org.example.dao;

import java.util.List;
import org.example.entity.Model;
import org.springframework.transaction.annotation.Transactional;


public interface Dao<T extends Model>
{

  @Transactional
  public abstract T create(T model);


  @Transactional
  public abstract T update(T model);


  @Transactional
  public abstract boolean delete(int modelId);


  @Transactional
  public abstract boolean delete(T model);


  @Transactional(readOnly = true)
  public abstract T find(int modelId);


  @Transactional(readOnly = true)
  public abstract T mandatoryId(int modelId);


  @Transactional(readOnly = true)
  public abstract List<T> findAll();

}
